//
//  SelectCouponsTableViewCell.m
//  FruitVIP
//
//  Created by 孙艳玲 on 15/7/1.
//  Copyright (c) 2015年 孙艳玲. All rights reserved.
//

#import "SelectCouponsTableViewCell.h"

#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)


@implementation SelectCouponsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self getUI];
    }
    return self;
}

- (void)getUI
{
       
    UILabel *firstLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 3 * SCREEN_WIDTH /4, 25)];
    firstLabel.text = @"满200减10";
//            firstLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:firstLabel];
    
    UILabel *secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(firstLabel.frame.origin.x, firstLabel.frame.origin.y + firstLabel.frame.size.height , firstLabel.frame.size.width, firstLabel.frame.size.height)];
    secondLabel.text = @"试用范围:仅可购买水果";
    secondLabel.textColor = [UIColor lightGrayColor];
    secondLabel.font = [UIFont systemFontOfSize:15];
//    secondLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:secondLabel];
    
    UILabel *thirdLabel = [[UILabel alloc] initWithFrame:CGRectMake(firstLabel.frame.origin.x, secondLabel.frame.origin.y + secondLabel.frame.size.height , secondLabel.frame.size.width, secondLabel.frame.size.height)];
    thirdLabel.text = @"有效期至:2015/06/20";
    thirdLabel.textColor = [UIColor lightGrayColor];
    thirdLabel.font = [UIFont systemFontOfSize:15];
    //        thirdLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:thirdLabel];
    
    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button.frame = CGRectMake(firstLabel.frame.origin.x + firstLabel.frame.size.width + 20, secondLabel.frame.origin.y, 25, 25);
    self.button.backgroundColor = [UIColor whiteColor];
    
    //设置圆角
    self.button.layer.cornerRadius = CGRectGetHeight([self.button bounds])/2;
    //边框颜色
    [self.button.layer setBorderWidth:1.0];
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGColorRef colorref = CGColorCreate(colorSpace,(CGFloat[]){ 230/255.0, 230/255.0, 230/255.0, 1});
    [self.button.layer setBorderColor:colorref];
    [self.contentView addSubview:self.button];

}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
